import * as permissionsManagement from '@/api/permissions-management'
const state = {
  // 根据id获取权限详情
  permissionDetail: []
}

const mutations = {
  // 根据id获取权限详情
  SET_PERMISSION_DETAIL: (state, newValue) => {
    state.permissionDetail = newValue
  }
}
const actions = {
  // 根据id获取权限详情
  async updatePermissionDetail(ctx, id) {
    const res = await permissionsManagement.getPermissionDetail(id)
    ctx.commit('SET_PERMISSION_DETAIL', res)
  }
}

export default {
  namespaced: true,
  state,
  mutations,
  actions
}
